package com.threadmethod.interrupt;

/**
 * @PackageName:com.threadmethod.interrupt
 * @ClassName:SubThread06
 * @Description:
 * @Author: zhangxiaoyu
 * @date 2020/11/19 17:37
 */
public class SubThread06 extends  Thread{
    @Override
    public void run() {
        super.run();
        for(int i =1;i<=10000;i++){
            //判断下线程的中断标志
            if(this.isInterrupted()){
                //返回中断标志
                System.out.println("当前线程中断！！！");
                //break;
                return;
            }

            System.out.println("打印："+i);
        }
    }
}
